****************************************************************************
****************** Replication of coder-level analysis *********************
* Behind the throne: Regime support coalitions around the world, 1789-2020 *
************* Knutsen, Dahlum, Rasmussen, Wig, 2024 BJPS *******************
****************************************************************************

use "C:\Users\carlhk\Dropbox\Supportcoal_datapaper\reduced_coderlevel_v12.dta", clear

save "C:\Users\carlhk\Dropbox\Supportcoal_datapaper\reduced_coderlevel_v12.dta", replace


** Table A2, Appendix II
 
regress distv2regsupgroupssize ayear i.ae_regionpol_6C alnFarGDPpc anv2clrspct av2x_freexp_altinf alnpope  ademocracy63 av2regsupgroupssize_nr  v2zzlibdem v2zzelcdem  i.v2zzfirstreas v2zzsatisf v2zztimespent if av2regsupgroupssize_nr>2, cluster(country_id) 
estimates store a

regress v2regsupgroupssize_beta ayear i.ae_regionpol_6C alnFarGDPpc anv2clrspct av2x_freexp_altinf alnpope  ademocracy63 av2regsupgroupssize_nr v2zzlibdem v2zzelcdem i.v2zzfirstreas v2zzsatisf v2zztimespent, cluster(country_id) 
estimates store b

regress v2regsupgroupssize_conf ayear i.ae_regionpol_6C alnFarGDPpc anv2clrspct av2x_freexp_altinf alnpope  ademocracy63 av2regsupgroupssize_nr v2zzlibdem v2zzelcdem i.v2zzfirstreas v2zzsatisf v2zztimespent, cluster(country_id) 
estimates store c 
estout a b c, cells(b(star fmt(%9.2f)) t(par fmt(%9.2f)))  rename(s_mil_loggdp Ln_GDP_pc s_bmr_democracy BMR_regime v2clrspct Impartial_public_admin s_bmr_democracy_trans BMR_democratic_transition v2x_Polyarchy Polyarchy) starlevels (* 0.05 ** 0.01) stats (N r2)style (fixed)


**Appendix IX
***LEAVE-one-out coder tests

sort country_id historical_date coder_id 
browse country_id historical_date coder_id v2regsupgroups_10 v2regimpgroup
generate countcoders =1
by country_id historical_date, sort: replace countcoders =. if coder_id==coder_id[_n-1] 	
sort country_id historical_date coder_id 
replace countcoders =. if v2regsupgroups_10==.

by country_id historical_date, sort: generate codersnr =sum(countcoders)
sort country_id historical_date coder_id 
replace codersnr = . if codersnr==0

by country_id historical_date, sort: egen codersmax =max(codersnr)
sort country_id historical_date coder_id 

replace codersmax =. if v2regsupgroups_10==.
replace codersnr =. if v2regsupgroups_10==.

**Numbers for Table A.7 (as well as similar numbers for all other groups not reported in Table A.7)
by country_id historical_date, sort: egen meanv2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_0 =mean(v2regsupgroups_0) if v2regsupgroups_0!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_0 mean1v2regsupgroups_0 mean2v2regsupgroups_0 mean3v2regsupgroups_0 mean4v2regsupgroups_0 mean5v2regsupgroups_0

by country_id historical_date, sort: egen meanv2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_1 =mean(v2regsupgroups_1) if v2regsupgroups_1!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_1 mean1v2regsupgroups_1 mean2v2regsupgroups_1 mean3v2regsupgroups_1 mean4v2regsupgroups_1 mean5v2regsupgroups_1

by country_id historical_date, sort: egen meanv2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_2 =mean(v2regsupgroups_2) if v2regsupgroups_2!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_2 mean1v2regsupgroups_2 mean2v2regsupgroups_2 mean3v2regsupgroups_2 mean4v2regsupgroups_2 mean5v2regsupgroups_2

by country_id historical_date, sort: egen meanv2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_3 =mean(v2regsupgroups_3) if v2regsupgroups_3!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_3 mean1v2regsupgroups_3 mean2v2regsupgroups_3 mean3v2regsupgroups_3 mean4v2regsupgroups_3 mean5v2regsupgroups_3

by country_id historical_date, sort: egen meanv2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_4 =mean(v2regsupgroups_4) if v2regsupgroups_4!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_4 mean1v2regsupgroups_4 mean2v2regsupgroups_4 mean3v2regsupgroups_4 mean4v2regsupgroups_4 mean5v2regsupgroups_4

by country_id historical_date, sort: egen meanv2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_5 =mean(v2regsupgroups_5) if v2regsupgroups_5!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_5 mean1v2regsupgroups_5 mean2v2regsupgroups_5 mean3v2regsupgroups_5 mean4v2regsupgroups_5 mean5v2regsupgroups_5

by country_id historical_date, sort: egen meanv2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_6 =mean(v2regsupgroups_6) if v2regsupgroups_6!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_6 mean1v2regsupgroups_6 mean2v2regsupgroups_6 mean3v2regsupgroups_6 mean4v2regsupgroups_6 mean5v2regsupgroups_6

by country_id historical_date, sort: egen meanv2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_7 =mean(v2regsupgroups_7) if v2regsupgroups_7!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_7 mean1v2regsupgroups_7 mean2v2regsupgroups_7 mean3v2regsupgroups_7 mean4v2regsupgroups_7 mean5v2regsupgroups_7

by country_id historical_date, sort: egen meanv2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_8 =mean(v2regsupgroups_8) if v2regsupgroups_8!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_8 mean1v2regsupgroups_8 mean2v2regsupgroups_8 mean3v2regsupgroups_8 mean4v2regsupgroups_8 mean5v2regsupgroups_8

by country_id historical_date, sort: egen meanv2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_9 =mean(v2regsupgroups_9) if v2regsupgroups_9!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_9 mean1v2regsupgroups_9 mean2v2regsupgroups_9 mean3v2regsupgroups_9 mean4v2regsupgroups_9 mean5v2regsupgroups_9

by country_id historical_date, sort: egen meanv2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_10 =mean(v2regsupgroups_10) if v2regsupgroups_10!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_10 mean1v2regsupgroups_10 mean2v2regsupgroups_10 mean3v2regsupgroups_10 mean4v2regsupgroups_10 mean5v2regsupgroups_10

by country_id historical_date, sort: egen meanv2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_11 =mean(v2regsupgroups_11) if v2regsupgroups_11!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_11 mean1v2regsupgroups_11 mean2v2regsupgroups_11 mean3v2regsupgroups_11 mean4v2regsupgroups_11 mean5v2regsupgroups_11

by country_id historical_date, sort: egen meanv2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_12 =mean(v2regsupgroups_12) if v2regsupgroups_12!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_12 mean1v2regsupgroups_12 mean2v2regsupgroups_12 mean3v2regsupgroups_12 mean4v2regsupgroups_12 mean5v2regsupgroups_12

by country_id historical_date, sort: egen meanv2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=. & codersnr!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=. & codersnr!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=. & codersnr!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=. & codersnr!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regsupgroups_13 =mean(v2regsupgroups_13) if v2regsupgroups_13!=. & codersnr!=5
sort country_id historical_date coder_id
correlate meanv2regsupgroups_13 mean1v2regsupgroups_13 mean2v2regsupgroups_13 mean3v2regsupgroups_13 mean4v2regsupgroups_13 mean5v2regsupgroups_13

**

*pwcorr pairwise correlations for leave one out if more than two coders

**all coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_0 mean2v2regsupgroups_0 if codersmax>1 &  codersnr==1
pwcorr meanv2regsupgroups_0 mean3v2regsupgroups_0 if codersmax>1 &  codersnr==1
pwcorr meanv2regsupgroups_0 mean4v2regsupgroups_0 if codersmax>1 &  codersnr==1
pwcorr meanv2regsupgroups_0 mean5v2regsupgroups_0 if codersmax>1 &  codersnr==1


pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_2 mean2v2regsupgroups_2 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_2 mean3v2regsupgroups_2 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_2 mean4v2regsupgroups_2 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_2 mean5v2regsupgroups_2 if codersmax>1 & codersnr==1

pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_10 mean2v2regsupgroups_10 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_10 mean3v2regsupgroups_10 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_10 mean4v2regsupgroups_10 if codersmax>1 & codersnr==1
pwcorr meanv2regsupgroups_10 mean5v2regsupgroups_10 if codersmax>1 & codersnr==1

**few coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_0 mean2v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_0 mean3v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_0 mean4v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_0 mean5v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==1


pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_2 mean2v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_2 mean3v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_2 mean4v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_2 mean5v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==1

pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_10 mean2v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_10 mean3v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_10 mean4v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==1
pwcorr meanv2regsupgroups_10 mean5v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==1


**many coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_0 mean2v2regsupgroups_0 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_0 mean3v2regsupgroups_0 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_0 mean4v2regsupgroups_0 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_0 mean5v2regsupgroups_0 if codersmax>3 & codersnr==1


pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_2 mean2v2regsupgroups_2 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_2 mean3v2regsupgroups_2 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_2 mean4v2regsupgroups_2 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_2 mean5v2regsupgroups_2 if codersmax>3 & codersnr==1

pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_10 mean2v2regsupgroups_10 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_10 mean3v2regsupgroups_10 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_10 mean4v2regsupgroups_10 if codersmax>3 & codersnr==1
pwcorr meanv2regsupgroups_10 mean5v2regsupgroups_10 if codersmax>3 & codersnr==1

**lots of coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>5 & codersnr==2
pwcorr meanv2regsupgroups_0 mean2v2regsupgroups_0 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_0 mean3v2regsupgroups_0 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_0 mean4v2regsupgroups_0 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_0 mean5v2regsupgroups_0 if codersmax>5 & codersnr==1


pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>5 & codersnr==2
pwcorr meanv2regsupgroups_2 mean2v2regsupgroups_2 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_2 mean3v2regsupgroups_2 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_2 mean4v2regsupgroups_2 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_2 mean5v2regsupgroups_2 if codersmax>5 & codersnr==1

pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>5 & codersnr==2
pwcorr meanv2regsupgroups_10 mean2v2regsupgroups_10 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_10 mean3v2regsupgroups_10 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_10 mean4v2regsupgroups_10 if codersmax>5 & codersnr==1
pwcorr meanv2regsupgroups_10 mean5v2regsupgroups_10 if codersmax>5 & codersnr==1


** Numbers for Table A.8
**DROPcoder 1 tests for all categories
*all coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_1 mean1v2regsupgroups_1 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_3 mean1v2regsupgroups_3 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_4 mean1v2regsupgroups_4 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_5 mean1v2regsupgroups_5 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_6 mean1v2regsupgroups_6 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_7 mean1v2regsupgroups_7 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_8 mean1v2regsupgroups_8 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_9 mean1v2regsupgroups_9 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_11 mean1v2regsupgroups_11 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_12 mean1v2regsupgroups_12 if codersmax>1 & codersnr==2
pwcorr meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>1 & codersnr==2

*finding nr obs
correlate meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>1 & codersnr==2

*few coders if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_1 mean1v2regsupgroups_1 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_3 mean1v2regsupgroups_3 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_4 mean1v2regsupgroups_4 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_5 mean1v2regsupgroups_5 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_6 mean1v2regsupgroups_6 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_7 mean1v2regsupgroups_7 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_8 mean1v2regsupgroups_8 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_9 mean1v2regsupgroups_9 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_11 mean1v2regsupgroups_11 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_12 mean1v2regsupgroups_12 if codersmax>1 & codersmax<4 & codersnr==2
pwcorr meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>1 & codersmax<4 & codersnr==2

correlate meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>1 & codersmax<4 & codersnr==2

*many coders
*all coders
pwcorr meanv2regsupgroups_0 mean1v2regsupgroups_0 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_1 mean1v2regsupgroups_1 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_2 mean1v2regsupgroups_2 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_3 mean1v2regsupgroups_3 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_4 mean1v2regsupgroups_4 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_5 mean1v2regsupgroups_5 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_6 mean1v2regsupgroups_6 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_7 mean1v2regsupgroups_7 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_8 mean1v2regsupgroups_8 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_9 mean1v2regsupgroups_9 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_10 mean1v2regsupgroups_10 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_11 mean1v2regsupgroups_11 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_12 mean1v2regsupgroups_12 if codersmax>3 & codersnr==2
pwcorr meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>3 & codersnr==2

correlate meanv2regsupgroups_13 mean1v2regsupgroups_13 if codersmax>3 & codersnr==2


**Doing the same for opposition groups as done for selected support groups in Table A.7 (not repoted in Table)
sort country_id historical_date coder_id 
browse country_id historical_date coder_id v2regoppgroups_10 v2regimpgroup
generate countcoderso =1
by country_id historical_date, sort: replace countcoderso =. if coder_id==coder_id[_n-1] 	
sort country_id historical_date coder_id 
replace countcoderso =. if v2regoppgroups_10==.

by country_id historical_date, sort: generate codersnro =sum(countcoderso)
sort country_id historical_date coder_id 
replace codersnro = . if codersnro==0

by country_id historical_date, sort: egen codersmaxo =max(codersnro)
sort country_id historical_date coder_id 

replace codersmaxo =. if v2regoppgroups_10==.
replace codersnro =. if v2regoppgroups_10==.

by country_id historical_date, sort: egen meanv2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_0 =mean(v2regoppgroups_0) if v2regoppgroups_0!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_0 mean1v2regoppgroups_0 mean2v2regoppgroups_0 mean3v2regoppgroups_0 mean4v2regoppgroups_0 mean5v2regoppgroups_0

by country_id historical_date, sort: egen meanv2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_1 =mean(v2regoppgroups_1) if v2regoppgroups_1!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_1 mean1v2regoppgroups_1 mean2v2regoppgroups_1 mean3v2regoppgroups_1 mean4v2regoppgroups_1 mean5v2regoppgroups_1

by country_id historical_date, sort: egen meanv2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_2 =mean(v2regoppgroups_2) if v2regoppgroups_2!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_2 mean1v2regoppgroups_2 mean2v2regoppgroups_2 mean3v2regoppgroups_2 mean4v2regoppgroups_2 mean5v2regoppgroups_2

by country_id historical_date, sort: egen meanv2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_3 =mean(v2regoppgroups_3) if v2regoppgroups_3!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_3 mean1v2regoppgroups_3 mean2v2regoppgroups_3 mean3v2regoppgroups_3 mean4v2regoppgroups_3 mean5v2regoppgroups_3

by country_id historical_date, sort: egen meanv2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_4 =mean(v2regoppgroups_4) if v2regoppgroups_4!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_4 mean1v2regoppgroups_4 mean2v2regoppgroups_4 mean3v2regoppgroups_4 mean4v2regoppgroups_4 mean5v2regoppgroups_4

by country_id historical_date, sort: egen meanv2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_5 =mean(v2regoppgroups_5) if v2regoppgroups_5!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_5 mean1v2regoppgroups_5 mean2v2regoppgroups_5 mean3v2regoppgroups_5 mean4v2regoppgroups_5 mean5v2regoppgroups_5

by country_id historical_date, sort: egen meanv2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_6 =mean(v2regoppgroups_6) if v2regoppgroups_6!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_6 mean1v2regoppgroups_6 mean2v2regoppgroups_6 mean3v2regoppgroups_6 mean4v2regoppgroups_6 mean5v2regoppgroups_6

by country_id historical_date, sort: egen meanv2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_7 =mean(v2regoppgroups_7) if v2regoppgroups_7!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_7 mean1v2regoppgroups_7 mean2v2regoppgroups_7 mean3v2regoppgroups_7 mean4v2regoppgroups_7 mean5v2regoppgroups_7

by country_id historical_date, sort: egen meanv2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_8 =mean(v2regoppgroups_8) if v2regoppgroups_8!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_8 mean1v2regoppgroups_8 mean2v2regoppgroups_8 mean3v2regoppgroups_8 mean4v2regoppgroups_8 mean5v2regoppgroups_8

by country_id historical_date, sort: egen meanv2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_9 =mean(v2regoppgroups_9) if v2regoppgroups_9!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_9 mean1v2regoppgroups_9 mean2v2regoppgroups_9 mean3v2regoppgroups_9 mean4v2regoppgroups_9 mean5v2regoppgroups_9

by country_id historical_date, sort: egen meanv2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_10 =mean(v2regoppgroups_10) if v2regoppgroups_10!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_10 mean1v2regoppgroups_10 mean2v2regoppgroups_10 mean3v2regoppgroups_10 mean4v2regoppgroups_10 mean5v2regoppgroups_10

by country_id historical_date, sort: egen meanv2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_11 =mean(v2regoppgroups_11) if v2regoppgroups_11!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_11 mean1v2regoppgroups_11 mean2v2regoppgroups_11 mean3v2regoppgroups_11 mean4v2regoppgroups_11 mean5v2regoppgroups_11

by country_id historical_date, sort: egen meanv2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_12 =mean(v2regoppgroups_12) if v2regoppgroups_12!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_12 mean1v2regoppgroups_12 mean2v2regoppgroups_12 mean3v2regoppgroups_12 mean4v2regoppgroups_12 mean5v2regoppgroups_12

by country_id historical_date, sort: egen meanv2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=.
sort country_id historical_date coder_id 
by country_id historical_date, sort: egen mean1v2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=. & codersnro!=1
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean2v2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=. & codersnro!=2
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean3v2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=. & codersnro!=3
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean4v2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=. & codersnro!=4
sort country_id historical_date coder_id
by country_id historical_date, sort: egen mean5v2regoppgroups_13 =mean(v2regoppgroups_13) if v2regoppgroups_13!=. & codersnro!=5
sort country_id historical_date coder_id
correlate meanv2regoppgroups_13 mean1v2regoppgroups_13 mean2v2regoppgroups_13 mean3v2regoppgroups_13 mean4v2regoppgroups_13 mean5v2regoppgroups_13

**Table A.8 numbers (for opposition groups)
**DROPcoder 1 tests for all categories
*all coders
pwcorr meanv2regoppgroups_0 mean1v2regoppgroups_0 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_1 mean1v2regoppgroups_1 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_2 mean1v2regoppgroups_2 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_3 mean1v2regoppgroups_3 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_4 mean1v2regoppgroups_4 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_5 mean1v2regoppgroups_5 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_6 mean1v2regoppgroups_6 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_7 mean1v2regoppgroups_7 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_8 mean1v2regoppgroups_8 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_9 mean1v2regoppgroups_9 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_10 mean1v2regoppgroups_10 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_11 mean1v2regoppgroups_11 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_12 mean1v2regoppgroups_12 if codersmaxo>1 & codersnro==2
pwcorr meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>1 & codersnro==2

*finding obs
correlate meanv2regoppgroups_0 mean1v2regoppgroups_0 if codersmaxo>1 & codersnro==2
correlate meanv2regoppgroups_1 mean1v2regoppgroups_1 if codersmaxo>1 & codersnro==2
correlate meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>1 & codersnro==2
*few coders if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_0 mean1v2regoppgroups_0 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_1 mean1v2regoppgroups_1 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_2 mean1v2regoppgroups_2 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_3 mean1v2regoppgroups_3 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_4 mean1v2regoppgroups_4 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_5 mean1v2regoppgroups_5 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_6 mean1v2regoppgroups_6 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_7 mean1v2regoppgroups_7 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_8 mean1v2regoppgroups_8 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_9 mean1v2regoppgroups_9 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_10 mean1v2regoppgroups_10 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_11 mean1v2regoppgroups_11 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_12 mean1v2regoppgroups_12 if codersmaxo>1 & codersmaxo<4 & codersnro==2
pwcorr meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>1 & codersmaxo<4 & codersnro==2

correlate meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>1 & codersmaxo<4 & codersnro==2

*many coders
*all coders
pwcorr meanv2regoppgroups_0 mean1v2regoppgroups_0 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_1 mean1v2regoppgroups_1 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_2 mean1v2regoppgroups_2 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_3 mean1v2regoppgroups_3 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_4 mean1v2regoppgroups_4 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_5 mean1v2regoppgroups_5 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_6 mean1v2regoppgroups_6 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_7 mean1v2regoppgroups_7 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_8 mean1v2regoppgroups_8 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_9 mean1v2regoppgroups_9 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_10 mean1v2regoppgroups_10 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_11 mean1v2regoppgroups_11 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_12 mean1v2regoppgroups_12 if codersmaxo>3 & codersnro==2
pwcorr meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>3 & codersnro==2

correlate meanv2regoppgroups_13 mean1v2regoppgroups_13 if codersmaxo>3 & codersnro==2

